<?php defined("MAIN_DIR") or die("No direct access");

$id = UV::rInt($route->getPath(4));

$file = $db->getCell("select `file` from `photos` where `id` = '$id' limit 1");
$filename = APP."files/img/photos/";
if (unlink($filename."z_".$file) && unlink($filename."x_".$file)){

	$query = "delete from `photos` where `id` = '{$id}' limit 1";
	if ($db->sendQuery($query) !== false){

		echo $id;
	}
}

?>